﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace UMLDesigner.GUI
{
    public partial class NewFileDialog : Form
    {
        public NewFileDialog()
        {
            InitializeComponent();
            diagramListbox.SelectedIndex = 0;
        }

        public string FileName
        {
            get
            {
                return name;
            }
        }

        public string FilePath
        {
            get
            {
                return path;
            }
        }

        public string SelectedDiagram
        {
            get
            {
                return selectedDiagram;
            }
        }

        private string name;
        private string path;
        private string selectedDiagram;

        private void okButton_Click(object sender, EventArgs e)
        {
            if (nameTextBox.Text == "")
            {
                MessageBox.Show("Enter the file name, please", "Error");
                DialogResult = System.Windows.Forms.DialogResult.None;
                return;
            }

            /*if (pathComboBox.Text == "")
            {
                MessageBox.Show("Enter the file path, please", "Error");
                DialogResult = System.Windows.Forms.DialogResult.None;
                return;
            }//*/

            name = nameTextBox.Text;
            path = pathComboBox.Text;
            selectedDiagram = diagramListbox.Text;
        }
    }
}
